/**
 * Copyright 2018-2019 Streamlit Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import "variables";
@import "fonts";
@import "~bootstrap/scss/bootstrap";

// IMPORTANT! This must come after the bootstrap import.
// Styletron creates classes called h1, h2, etc., which conflict with Bootstrap classes.
// So we have to override the bootstrap classes here. (We should not use these classes in our project)
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  all: unset;
}

// Use this file to override specific bootstrap styles.

.btn-outline-primary {
  border-color: $gray-lighter;
  color: $black;
}

.btn-outline-secondary {
  border-color: transparent;
  color: $black;
}

.btn-outline-info {
  background-color: $white;
  border-color: $gray-lighter;
  color: $gray-darker;
}

.btn-outline-primary:not(:disabled):not(.disabled):hover,
.btn-outline-secondary:not(:disabled):not(.disabled):hover,
.btn-outline-info:not(:disabled):not(.disabled):hover,
.btn-outline-primary:not(:disabled):not(.disabled):focus,
.btn-outline-secondary:not(:disabled):not(.disabled):focus,
.btn-outline-info:not(:disabled):not(.disabled):focus {
  background-color: $white;
  border-color: $primary;
  color: $primary;
}

.btn-outline-primary:not(:disabled):not(.disabled):focus,
.btn-outline-secondary:not(:disabled):not(.disabled):focus,
.btn-outline-info:not(:disabled):not(.disabled):focus {
  box-shadow: 0 0 0 0.2rem $primary-a50;
}

.btn-outline-primary:not(:disabled):not(.disabled).active,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-secondary:not(:disabled):not(.disabled).active,
.btn-outline-secondary:not(:disabled):not(.disabled):active,
.btn-outline-info:not(:disabled):not(.disabled).active,
.btn-outline-info:not(:disabled):not(.disabled):active {
  background-color: $primary;
  border-color: $primary;
  color: $white;
}

// Make alert boxes work on different backgrounds.

.alert-success {
  background: change-color($green, $alpha: 0.2);
  border-color: change-color($green, $alpha: 0.2);
}

.alert-info {
  background: change-color($blue, $alpha: 0.1);
  border-color: change-color($blue, $alpha: 0.1);
}

.alert-warning {
  background: change-color($yellow, $alpha: 0.2);
  border-color: change-color($yellow, $alpha: 0.8);
}

.alert-danger {
  background: change-color($red, $alpha: 0.2);
  border-color: change-color($red, $alpha: 0.2);
}

// Undo bootstrap changes to classes that Styletron uses and we don't.

.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  all: unset;
}

// Make scrollbars awesome on Chrome.

::-webkit-scrollbar {
  background-color: transparent;
  border-radius: 100px;
  height: 6px;
  width: 6px;
}

::-webkit-scrollbar:hover {
  background-color: rgba(0, 0, 0, 0.09);
}

::-webkit-scrollbar-thumb:vertical,
::-webkit-scrollbar-thumb:horizontal {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:vertical:active,
::-webkit-scrollbar-thumb:horizontal:active {
  background: rgba(0, 0, 0, 0.61);
  border-radius: 100px;
}
